package com.example.actuator.service;

import java.lang.ref.PhantomReference;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;

public class InvokeTest {
    public static void main(String[] args) {

        // 强引用
        Object object = new Object();

        // 软引用
        SoftReference<Object> softReference = new SoftReference<>(new Object());
        object = null;

        // 弱引用
        WeakReference<Object> weakReference = new WeakReference<>(new Object());
        object = null;

        // 虚引用
        PhantomReference<Object> pf = new PhantomReference<Object>(object, null);
        object = null;
    }
}
